Imports System.IO
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports System.Runtime.CompilerServices

Public Module BinaryReaderExtensions
    <Extension()> _
    Public Function EReadUInt32(ByVal reader As BinaryReader) As UInt32
        Dim bytes = reader.ReadBytes(4)
        Return bytes(0) * 255 ^ 3 + bytes(1) * 255 ^ 2 + bytes(2) * 255 ^ 1 + bytes(3)
    End Function

    <Extension()> _
    Public Function EReadUInt16(ByVal reader As BinaryReader) As UInt16
        Dim bytes = reader.ReadBytes(2)
        Return bytes(0) * 255 ^ 1 + bytes(1)
    End Function

    <Extension()> _
    Public Function ReadTeamNumber(ByVal reader As BinaryReader) As Integer
        Dim temp1 = reader.ReadByte()
        Dim temp2 = reader.ReadByte()
        Return temp1 * 100 + temp2
    End Function
End Module
